import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

Item {
    id: parameterWindowBack
    width: 1820
    height: 980

    // Rectangle{
    //     anchors.fill: parent
    //     color: "gold"

    //     Text{
    //         anchors.centerIn: parent
    //         font.pixelSize: 50
    //         font.bold: true
    //         text: qsTr("参数设置界面")
    //     }
    // }

    property int parameter_CurrentPage: 1

    Component.onCompleted: {
        parameterLoader.source = "Parameter_Manual.qml"
    }

    Row{
        anchors.top: parameterWindowBack.top
        anchors.topMargin: 10
        anchors.left: parameterWindowBack.left
        anchors.leftMargin: 10
        spacing: 10

        A_Button{
            buttonWidth: 120
            buttonHeight: 50
            contentText_Data: qsTr("手动参数")
            isSelected: parameter_CurrentPage === 1
            onButtonClicked: {
                parameter_CurrentPage = 1
                parameterLoader.source = "Parameter_Manual.qml"
            }
        }

        A_Button{
            buttonWidth: 120
            buttonHeight: 50
            contentText_Data: qsTr("速度参数")
            isSelected: parameter_CurrentPage === 2
            onButtonClicked: {
                parameter_CurrentPage = 2
                parameterLoader.source = "Parameter_Speed.qml"
            }
        }

        A_Button{
            buttonWidth: 120
            buttonHeight: 50
            contentText_Data: qsTr("位置参数")
            isSelected: parameter_CurrentPage === 3
            onButtonClicked: {
                parameter_CurrentPage = 3
                parameterLoader.source = "Parameter_Location.qml"
            }
        }

        A_Button{
            buttonWidth: 120
            buttonHeight: 50
            contentText_Data: qsTr("模式选择")
            isSelected: parameter_CurrentPage === 4
            onButtonClicked: {
                parameter_CurrentPage = 4
                parameterLoader.source = "Parameter_ChangeMode.qml"
            }
        }

        A_Button{
            buttonWidth: 120
            buttonHeight: 50
            contentText_Data: qsTr("时间参数")
            isSelected: parameter_CurrentPage === 5
            onButtonClicked: {
                parameter_CurrentPage = 5
                parameterLoader.source = "Parameter_Time.qml"
            }
        }

        A_Button{
            buttonWidth: 120
            buttonHeight: 50
            contentText_Data: qsTr("刀具参数")
            isSelected: parameter_CurrentPage === 6
            onButtonClicked: {
                parameter_CurrentPage = 6
                parameterLoader.source = "Parameter_Knife.qml"
            }
        }

        A_Button{
            buttonWidth: 120
            buttonHeight: 50
            contentText_Data: qsTr("机械参数")
            isSelected: parameter_CurrentPage === 7
            onButtonClicked: {
                parameter_CurrentPage = 7
                parameterLoader.source = "Parameter_Mechine.qml"
            }
        }


    }


    Loader{
        id: parameterLoader
        anchors.top: parameterWindowBack.top
        anchors.topMargin: 70
        anchors.left: parameterWindowBack.left
        // anchors.leftMargin: 95
        onSourceChanged: {
            console.log("已加载: "+ source)
        }

    }








}
